package com.ytg.myapi.view;

import android.content.Context;
import android.util.AttributeSet;
import android.widget.RadioGroup;

import com.ytg.myapi.BindWay;

/**
 * Created by ximsfei on 2017/1/10.
 */

public class SkinCompatRadioGroup extends RadioGroup {
    public SkinCompatRadioGroup(Context context) {
        super(context);
    }

    public SkinCompatRadioGroup(Context context, AttributeSet attrs) {
        super(context, attrs);
//setBackgroundColor(Color.RED);
        setOnCheckedChangeListener(new OnCheckedChangeListener() {
            @Override
            public void onCheckedChanged(RadioGroup group, int checkedId) {
                if (null != BindWay.getInstance().checkedBack) {
                    BindWay.getInstance().checkedBack.onCheckedChanged(group, checkedId);
                }
            }
        });
//        setOnClickListener(new OnClickListener() {
//            @Override
//            public void onClick(View v) {
//                if (null != BindWay.getInstance().checkedBack) {
//                    BindWay.getInstance().checkedBack.onCheckedChanged(SkinCompatRadioGroup.this, getCheckedRadioButtonId());
//                }
//            }
//        });
    }

}
